var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

router.post('/',function(req,res,next){
  var body = req.body;
  var email = body['email'];
  var password = body['password'];
  var loginIp = req.ip;
  req.session.sessionName = email;
  req.session.ip = loginIp;
  req.session.password = password;
  req.session.save();
  res.render("index");
});

module.exports = router;
